package com.mind.adjust.service.impl;

import com.mind.customer.mapper.AjBasicDatadditionMapper;
import com.mind.system.domain.AjBasicDataddition;
import com.mind.adjust.service.AjBasicDatadditionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * (AjBasicDataddition)表服务实现类
 *
 * @author makejava
 * @since 2024-10-14 10:37:22
 */
@Service("basicDatadditionService")
public class AjBasicDatadditionServiceImpl implements AjBasicDatadditionService {
    @Autowired
    private AjBasicDatadditionMapper basicDatadditionMapper;

    /**
     * 查询信息集合
     * 
     * @param basicDataddition 信息
     * @return 信息集合
     */
    @Override
    public List<AjBasicDataddition> selectBasicDatadditionList(AjBasicDataddition basicDataddition)
    {
        return basicDatadditionMapper.selectBasicDatadditionList(basicDataddition);
    }

    /**
     * 通过ID查询信息
     * 
     * @param basicDatadditionId ID
     * @return 角色对象信息
     */
    @Override
    public AjBasicDataddition selectBasicDatadditionById(Long basicDatadditionId)
    {
        return basicDatadditionMapper.selectBasicDatadditionById(basicDatadditionId);
    }

    /**
     * 删除信息
     * 
     * @param basicDatadditionId ID
     * @return 结果
     */
    @Override
    public int deleteBasicDatadditionById(Long basicDatadditionId)
    {
        return basicDatadditionMapper.deleteBasicDatadditionById(basicDatadditionId);
    }

    /**
     * 批量删除信息
     * 
     * @param basicDatadditionIds 需要删除的ID
     * @return 结果
     */
    @Override
    public int deleteBasicDatadditionByIds(Long[] basicDatadditionIds)
    {
        return basicDatadditionMapper.deleteBasicDatadditionByIds(basicDatadditionIds);
    }

    /**
     * 新增保存信息
     * 
     * @param basicDataddition 信息
     * @return 结果
     */
    @Override
    public int insertBasicDataddition(AjBasicDataddition basicDataddition)
    {
        return basicDatadditionMapper.insertBasicDataddition(basicDataddition);
    }

    /**
     * 修改保存信息
     * 
     * @param basicDataddition 信息
     * @return 结果
     */
    @Override
    public int updateBasicDataddition(AjBasicDataddition basicDataddition)
    {
        return basicDatadditionMapper.updateBasicDataddition(basicDataddition);
    }
    
    /**
     * 批量插入
     *
     * @param basicDatadditionList 附件类型信息
     * @return 结果
     */
    @Override
    public int batchInsert(List<AjBasicDataddition> basicDatadditionList) {
        int size = 0;
        for(AjBasicDataddition basicDataddition: basicDatadditionList) {
//            if (basicDatadditionMapper.selectBasicDatadditionByName(basicDataddition.getName()) == null){
//                basicDatadditionMapper.insertBasicDataddition(basicDataddition);
//                size ++;
//            }
        }
        return size;
    }
}
